﻿using System;
using System.Collections.Generic;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.BussinessVoucher
{
    /// <summary>
    /// FixedAssetVoucher
    /// </summary>
    public class FixedAssetVoucher : BusinessObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FixedAssetVoucher"/> class.
        /// </summary>
        public FixedAssetVoucher()
        {
            AddRule(new ValidateRequired("RefTypeId"));
            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateRequired("RefDate"));
            AddRule(new ValidateRequired("PostedDate"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FixedAssetVoucher"/> class.
        /// </summary>
        /// <param name="refId">The reference identifier.</param>
        /// <param name="refTypeId">Type of the reference.</param>
        /// <param name="refDate">The reference date.</param>
        /// <param name="postedDate">The posted date.</param>
        /// <param name="refNo">The reference no.</param>
        /// <param name="accountingObjectType">Type of the accounting object.</param>
        /// <param name="accountingObjectId">The accounting object identifier.</param>
        /// <param name="customerId">The customer identifier.</param>
        /// <param name="vendorId">The vendor identifier.</param>
        /// <param name="employeeId">The employee identifier.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <param name="totalAmount"> </param>
        /// <param name="journalMemo">The journal memo.</param>
        public FixedAssetVoucher(long refId, int refTypeId, DateTime refDate, DateTime postedDate, string refNo, int accountingObjectType, long accountingObjectId,
                             long customerId, long vendorId, long employeeId,string currencyCode,decimal totalAmount, string journalMemo,long unitId)
        {
            RefId = refId;
            RefTypeId = refTypeId;
            RefDate = refDate;
            PostedDate = postedDate;
            RefNo = refNo;
            AccountingObjectType = accountingObjectType;
            AccountingObjectId = accountingObjectId;
            CustomerId = customerId;
            VendorId = vendorId;
            EmployeeId = employeeId;
            CurrencyCode = currencyCode;
            TotalAmount = totalAmount;
            JournalMemo = journalMemo;
            UnitId = unitId;
        }

        /// <summary>
        /// Gets or sets the reference identifier.
        /// </summary>
        /// <value>The reference identifier.</value>
        public long RefId { get; set; }

        /// <summary>
        /// Gets or sets the type of the reference.
        /// </summary>
        /// <value>The type of the reference.</value>
        public long RefTypeId { get; set; }

        /// <summary>
        /// Gets or sets the reference date.
        /// </summary>
        /// <value>The reference date.</value>
        public DateTime RefDate { get; set; }

        /// <summary>
        /// Gets or sets the posted date.
        /// </summary>
        /// <value>The posted date.</value>
        public DateTime PostedDate { get; set; }

        /// <summary>
        /// Gets or sets the reference no.
        /// </summary>
        /// <value>The reference no.</value>
        public string RefNo { get; set; }

        /// <summary>
        /// Gets or sets the type of the accounting object.
        /// </summary>
        /// <value>The type of the accounting object.</value>
        public int AccountingObjectType { get; set; }

        /// <summary>
        /// Gets or sets the accounting object identifier.
        /// </summary>
        /// <value>The accounting object identifier.</value>
        public long AccountingObjectId { get; set; }

        /// <summary>
        /// Gets or sets the customer identifier.
        /// </summary>
        /// <value>The customer identifier.</value>
        public long CustomerId { get; set; }

        /// <summary>
        /// Gets or sets the vendor identifier.
        /// </summary>
        /// <value>The vendor identifier.</value>
        public long VendorId { get; set; }

        /// <summary>
        /// Gets or sets the employee identifier.
        /// </summary>
        /// <value>The employee identifier.</value>
        public long EmployeeId { get; set; }

        /// <summary>
        /// Gets or sets the currency code.
        /// </summary>
        /// <value>The currency code.</value>
        public string CurrencyCode { get; set; }

        /// <summary>
        /// Gets or sets the total amount oc.
        /// </summary>
        /// <value>The total amount oc.</value>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// Gets or sets the journal memo.
        /// </summary>
        /// <value>The journal memo.</value>
        public string JournalMemo { get; set; }

        /// <summary>
        /// Gets or sets the journal memo.
        /// </summary>
        /// <value>The journal memo.</value>
        public long UnitId { get; set; }

        /// <summary>
        /// Gets or sets the estimate details.
        /// </summary>
        /// <value>
        /// The deposit details.
        /// </value>
        public IList<FixedAssetVoucherDetail> FixedAssetIncrementDetails { get; set; }
    }
}
